package org.datastructure.secondday.search;

import java.util.Arrays;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.ObjIntConsumer;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class SeqSearch {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,9};
        seqSearch(arr,2);
    }

    public static int seqSearch(int[] arr, int key) {
        for (int i = 0; i < arr.length; i++) {
            if (key == arr[i]) {
                return i;
            }
        }
        return -1;
    }
}
